package com.cloud.zookeeper.provider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2021/10/13 17:47
 */
@RestController
public class TestController {
    /**
     * http://127.0.0.1:4411/echo?name=11
     *
     * @param name
     * @return
     */

    @Value(value = "${server.port:'8080'}")
    private String serverPort;

    @GetMapping("/echo")
    public String echo(@RequestParam(value = "name") String name) {

        return "provider:" + serverPort + "---" + name;
    }

}
